package org.zk.dubbo_provider.dao;


import org.zk.entity.Broadcast;

import java.util.List;
import java.util.Map;
import org.zk.entity.Broadcast;
import org.zk.entity.Course;
import org.zk.entity.Teacher;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author Alicelonely
 * @since 2019-12-11
 */
public interface BroadcastMapper {
    /*发布直播*/
    int addBroadcast(Broadcast broadcast);

    /**
     * 查询老师当前发布的所有直播,正在直播的课程，已开始直播的课程，未开始直播的课程，还有已结束的课程
     *
     * @param map 参数当中有currTime为当前时间，需要根据当前时间判断直播知否开始，之外还有一个broadcast的对象
     * @return
     */
    List<Broadcast> getBroadcastByIdByPage(Map<String, Object> map);

    /**
     * 分页查询直播课的条数
     *
     * @param map
     * @return
     */
    int getBroadcastCountByIdByPage(Map<String, Object> map);

    /**
     * 删除该直播
     *
     * @param broadcast
     * @return
     */
    int deleteBroadcastById(Broadcast broadcast);

    /**
     * 更改直播
     * @param broadcast
     * @return
     */
    int updateBroadcast(Broadcast broadcast);

    /**
     * @MethodName: getBroadcastAndTeacherByBroadcastId
     * @Description: 根据直播的id查询直播和老师信息
     * @Param: [broadcastId]
     * @Return: org.zk.entity.Broadcast
     * @Author: 刘艺广
     * @Time: 2019/12/25 0025 下午 8:17
     **/

    Broadcast getBroadcastAndTeacherByBroadcastId(int broadcastId);

    //分页查询所有课程
    List<Broadcast> getAllList(Map<String,Object> map);

    //查询课程表中course的数量
    int getBroadcastCount(Map<String,Object> map);

    //course审核
    int updateFlag(Broadcast broadcast);

    //根据直播Id查询当前直播
    Broadcast getBroadcastById(int broadcastId);

    //高申 2019-12-17 支付成功，课程销量+1
    void updateBroadcastCount(Broadcast broadcast);

    /*根据一级分类查询当前正在直播的课程*/
    List<Broadcast> getBraodcastBeingByTypeId(Map map);

    //综合查询所有直播课程
    List<Broadcast> getAllBroadcastList(Map map);

    //查询所有直播的数量
    int getAllBroadcastListCount(Map map);
}
